package com.xiaoxu.auth.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xiaoxu.auth.model.po.Menu;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @description  MenuMapper 接口
 * @author xiaoxu
 */
@Mapper
public interface MenuMapper extends BaseMapper<Menu> {
    @Select("SELECT	* FROM xc_menu WHERE id IN (SELECT menu_id FROM xc_permission WHERE role_id IN ( SELECT role_id FROM xc_user_role WHERE user_id = #{userId} ))")
    List<Menu> selectPermissionByUserId(@Param("userId") String userId);
}
